import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import sass from 'sass'
import tailwindcss from '@tailwindcss/vite'

// https://vitejs.dev/config/
export default defineConfig({
    base: './',
    plugins: [
        vue(),
        tailwindcss(),
    ],
    server: {
        proxy: {
            '/yujn': {
                target: 'http://api.yujn.cn',
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/yujn/, '')
            }
        }
    },
    resolve: {
        alias: {
            '@': '/src',
        }
    },
    css: {
        preprocessorOptions: {
            scss: {
                implementation: sass // 明确使用 Dart Sass
            }
        }
    }
})
